package com.tiantianyuegou.model;

/**
 * Created by ivany on 2016/1/20.
 */
public class TaxModel implements Comparable<TaxModel> {
    private int id;
    private String code;
    private String label;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public int compareTo(TaxModel another) {
        int localTax = Integer.parseInt(this.getLabel().substring(0, this.getLabel().length() - 1));
        int tax = Integer.parseInt(another.getLabel().substring(0, another.getLabel().length() -1));
        if (localTax > tax) {
            return 0;
        } else {
            return -1;
        }
    }
}
